package com.itcam.controller;

//2.演示@RequestMapping也可以修饰在类上。
//     @RequestMapping还可以指定请求方式
//     @RequestMapping的进阶注解：4个

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/hello02")
@Controller
public class Hello02Controller {

    //http://localhost:8080/hello02/h01
    @RequestMapping("/h01")
    @ResponseBody
    public String h01(){
        System.out.println("Hello02 - h01() ...");
        return "succ" ;
    }

    //http://localhost:8080/hello02/h01/9   DELETE
    //http://localhost:8080/hello02/h01
    @RequestMapping(value="/h02",method = {RequestMethod.GET,RequestMethod.DELETE})
    @ResponseBody
    public String h02(){
        System.out.println("Hello02 - h01() ...");
        return "succ" ;
    }

    //@RequestMapping(value="/h03",method = RequestMethod.PUT)
    @PutMapping("/h03")
    @ResponseBody
    public String h03(){
        System.out.println("Hello02 - h01() ...");
        return "succ" ;
    }
}
